package models

import (
	"errors"
	goerrors "github.com/go-errors/errors"
	"test/app/results"
)

func Test() error {
	return results.New("success")
}

func TestErr() error {
	return results.NewError(0, "zh-CN", errors.New("error"))
}

func Validate() error {
	goerrors.MaxStackDepth = 5
	//return results.NewError(1, "captcha invalid")
	return test3()
}

func test3() error {
	return test2()
}

func test2() error {
	return test1()
}

func test1() error {
	return goerrors.Wrap(test(), 0)
}

func test() error {
	return errors.New("error")
}
